<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>优雅的双栏登录注册页面</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            display: flex;
            height: 100vh;
            overflow: hidden;
            background: #f5f5f5;
        }

        /* 左侧图片区域 */
        .image-section {
            flex: 1;
            background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('https://images.unsplash.com/photo-1682686580391-615b3e827d64?ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=880&q=80') no-repeat center center;
            background-size: cover;
            color: white;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 2rem;
            position: relative;
            overflow: hidden;
        }

        .image-content {
            z-index: 2;
            text-align: center;
            max-width: 500px;
        }

        .image-content h1 {
            font-size: 2.5rem;
            margin-bottom: 1rem;
            font-weight: 700;
        }

        .image-content p {
            font-size: 1.1rem;
            margin-bottom: 2rem;
            line-height: 1.6;
        }

        .image-section::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, rgba(106, 17, 203, 0.8) 0%, rgba(37, 117, 252, 0.8) 100%);
            z-index: 1;
        }

        /* 右侧表单区域 */
        .form-section {
            width: 450px;
            background: white;
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 2rem;
            position: relative;
            overflow-y: auto;
        }

        .form-container {
            width: 100%;
            max-width: 350px;
            margin: 0 auto;
        }

        .logo {
            text-align: center;
            margin-bottom: 2rem;
        }

        .logo h2 {
            color: #333;
            font-size: 1.8rem;
            font-weight: 700;
        }

        .logo p {
            color: #777;
            font-size: 0.9rem;
            margin-top: 0.5rem;
        }

        .tabs {
            display: flex;
            margin-bottom: 2rem;
            border-bottom: 1px solid #eee;
        }

        .tab {
            flex: 1;
            text-align: center;
            padding: 0.8rem 0;
            cursor: pointer;
            color: #777;
            font-weight: 600;
            transition: all 0.3s ease;
            position: relative;
        }

        .tab.active {
            color: #6a11cb;
        }

        .tab.active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 50%;
            transform: translateX(-50%);
            width: 50%;
            height: 3px;
            background: linear-gradient(to right, #6a11cb, #2575fc);
            border-radius: 3px;
        }

        .form {
            display: none;
        }

        .form.active {
            display: block;
            animation: fadeIn 0.5s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .form-group {
            margin-bottom: 1.5rem;
            position: relative;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            color: #555;
            font-size: 0.9rem;
            font-weight: 500;
        }

        .form-group input {
            width: 100%;
            padding: 0.8rem 1rem;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 0.95rem;
            transition: all 0.3s ease;
        }

        .form-group input:focus {
            border-color: #6a11cb;
            box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
            outline: none;
        }

        .form-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            font-size: 0.9rem;
        }

        .remember-me {
            display: flex;
            align-items: center;
        }

        .remember-me input {
            margin-right: 0.5rem;
        }

        .forgot-password {
            color: #6a11cb;
            text-decoration: none;
            font-weight: 500;
        }

        .forgot-password:hover {
            text-decoration: underline;
        }

        .btn {
            width: 100%;
            padding: 0.8rem;
            border: none;
            border-radius: 6px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .btn-primary {
            background: linear-gradient(to right, #6a11cb, #2575fc);
            color: white;
            margin-bottom: 1.5rem;
        }

        .btn-primary:hover {
            opacity: 0.9;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
        }

        .divider {
            text-align: center;
            margin: 1.5rem 0;
            position: relative;
            color: #999;
            font-size: 0.9rem;
        }

        .divider::before, .divider::after {
            content: '';
            position: absolute;
            top: 50%;
            width: 40%;
            height: 1px;
            background: #eee;
        }

        .divider::before {
            left: 0;
        }

        .divider::after {
            right: 0;
        }

        .social-login {
            display: flex;
            justify-content: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .social-btn {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.2rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .social-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .facebook {
            background: #3b5998;
        }

        .google {
            background: #db4437;
        }

        .twitter {
            background: #1da1f2;
        }

        .signup-link {
            text-align: center;
            margin-top: 1.5rem;
            color: #777;
            font-size: 0.9rem;
        }

        .signup-link a {
            color: #6a11cb;
            text-decoration: none;
            font-weight: 500;
        }

        .signup-link a:hover {
            text-decoration: underline;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            body {
                flex-direction: column;
            }

            .image-section {
                display: none;
            }

            .form-section {
                width: 100%;
                height: 100vh;
            }
        }

        /* 动画元素 */
        .floating-elements {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            overflow: hidden;
            z-index: 0;
        }

        .floating-element {
            position: absolute;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
        }
    </style>
</head>
<body>
<!-- 左侧图片区域 -->
<div class="image-section">
    <div class="floating-elements" id="floatingElements"></div>
    <div class="image-content">
        <h1>欢迎回来</h1>
        <p>加入我们的社区，发现无限可能。无论您是第一次访问还是老用户，我们都为您准备了精彩的体验。</p>
    </div>
</div>

<!-- 右侧表单区域 -->
<div class="form-section">
    <div class="form-container">
        <div class="logo">
            <h2>Acme Inc</h2>
            <p>让生活更简单</p>
        </div>

        <div class="tabs">
            <div class="tab active" data-tab="login">登录</div>
            <div class="tab" data-tab="register">注册</div>
        </div>

        <!-- 登录表单 -->
        <form class="form active" id="loginForm">
            <div class="form-group">
                <label for="loginEmail">电子邮箱</label>
                <input type="email" id="loginEmail" placeholder="请输入您的邮箱" required>
            </div>
            <div class="form-group">
                <label for="loginPassword">密码</label>
                <input type="password" id="loginPassword" placeholder="请输入您的密码" required>
            </div>
            <div class="form-footer">
                <div class="remember-me">
                    <input type="checkbox" id="rememberMe">
                    <label for="rememberMe">记住我</label>
                </div>
                <a href="#" class="forgot-password">忘记密码?</a>
            </div>
            <button type="submit" class="btn btn-primary">登录</button>
            <div class="divider">或</div>
            <div class="social-login">
                <div class="social-btn facebook">
                    <i class="fab fa-facebook-f"></i>
                </div>
                <div class="social-btn google">
                    <i class="fab fa-google"></i>
                </div>
                <div class="social-btn twitter">
                    <i class="fab fa-twitter"></i>
                </div>
            </div>
            <div class="signup-link">
                还没有账号? <a href="#" id="showRegister">立即注册</a>
            </div>
        </form>

        <!-- 注册表单 -->
        <form class="form" id="registerForm">
            <div class="form-group">
                <label for="registerName">用户名</label>
                <input type="text" id="registerName" placeholder="请输入您的用户名" required>
            </div>
            <div class="form-group">
                <label for="registerEmail">电子邮箱</label>
                <input type="email" id="registerEmail" placeholder="请输入您的邮箱" required>
            </div>
            <div class="form-group">
                <label for="registerPassword">密码</label>
                <input type="password" id="registerPassword" placeholder="请输入您的密码" required>
            </div>
            <div class="form-group">
                <label for="registerConfirmPassword">确认密码</label>
                <input type="password" id="registerConfirmPassword" placeholder="请再次输入密码" required>
            </div>
            <button type="submit" class="btn btn-primary">注册</button>
            <div class="signup-link">
                已有账号? <a href="#" id="showLogin">立即登录</a>
            </div>
        </form>
    </div>
</div>

<script>
    // 切换登录/注册表单
    const tabs = document.querySelectorAll('.tab');
    const forms = document.querySelectorAll('.form');
    const showRegister = document.getElementById('showRegister');
    const showLogin = document.getElementById('showLogin');

    tabs.forEach(tab => {
        tab.addEventListener('click', () => {
            const tabId = tab.getAttribute('data-tab');

            // 更新标签状态
            tabs.forEach(t => t.classList.remove('active'));
            tab.classList.add('active');

            // 更新表单状态
            forms.forEach(form => form.classList.remove('active'));
            document.getElementById(`${tabId}Form`).classList.add('active');
        });
    });

    showRegister.addEventListener('click', (e) => {
        e.preventDefault();
        tabs[1].click();
    });

    showLogin.addEventListener('click', (e) => {
        e.preventDefault();
        tabs[0].click();
    });

    // 表单提交处理
    document.getElementById('loginForm').addEventListener('submit', (e) => {
        e.preventDefault();
        alert('登录功能将在后端实现');
    });

    document.getElementById('registerForm').addEventListener('submit', (e) => {
        e.preventDefault();
        alert('注册功能将在后端实现');
    });

    // 创建浮动背景元素动画
    const floatingElements = document.getElementById('floatingElements');
    const colors = ['rgba(255, 255, 255, 0.2)', 'rgba(255, 255, 255, 0.15)', 'rgba(255, 255, 255, 0.1)'];

    for (let i = 0; i < 15; i++) {
        const element = document.createElement('div');
        element.classList.add('floating-element');

        const size = Math.random() * 100 + 50;
        const color = colors[Math.floor(Math.random() * colors.length)];

        element.style.width = `${size}px`;
        element.style.height = `${size}px`;
        element.style.background = color;
        element.style.left = `${Math.random() * 100}%`;
        element.style.top = `${Math.random() * 100}%`;

        floatingElements.appendChild(element);

        // GSAP动画
        gsap.to(element, {
            x: Math.random() * 200 - 100,
            y: Math.random() * 200 - 100,
            duration: Math.random() * 20 + 10,
            repeat: -1,
            yoyo: true,
            ease: "sine.inOut"
        });
    }

    // 页面加载动画
    gsap.from(".image-content", {
        opacity: 0,
        y: 50,
        duration: 1,
        delay: 0.5
    });

    gsap.from(".form-container", {
        opacity: 0,
        x: 50,
        duration: 1,
        delay: 0.8
    });
</script>
</body>
</html>